Support ACLP alerts integration with Linode#650
Open
yec-akamai wants to merge 2 commits intolinode:proj/aclp-linode-alertsfrom
Open
Support ACLP alerts integration with Linode#650yec-akamai wants to merge 2 commits intolinode:proj/aclp-linode-alertsfrom
yec-akamai wants to merge 2 commits intolinode:proj/aclp-linode-alertsfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for specifying and reading ACLP alert configuration on Linode Instances, including wiring the alerts field through instance create/clone flows and validating behavior via updated unit fixtures/tests.
Changes:
- Added
InstanceAlerts/InstanceACLPAlertsOptionsJSON-object models and mappedInstance.alertstoInstanceAlerts. - Added
alertssupport toLinodeGroup.instance_create(...)andInstance.clone(...). - Updated unit tests and fixtures to include
system_alerts/user_alertsand added a clone test case.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
linode_api4/objects/linode.py |
Adds alert JSON-object types, maps Instance.alerts, and adds alerts support to Instance.clone. |
linode_api4/groups/linode.py |
Adds alerts parameter to instance creation request body. |
test/unit/objects/linode_test.py |
Extends unit coverage for reading/writing alerts and adds clone-with-alerts test. |
test/fixtures/linode_instances.json |
Updates instance list fixture to include ACLP alert IDs. |
test/fixtures/linode_instances_123_clone.json |
Adds clone response fixture including alerts payload. |
test/integration/models/sharegroups/test_sharegroups.py |
Minor import formatting cleanup. |
Comments suppressed due to low confidence (1)
linode_api4/objects/linode.py:1858
alertswas added beforeplacement_groupinInstance.clone, which breaks callers that passplacement_grouppositionally (it will now be interpreted asalerts). To avoid a positional-argument breaking change, movealertsto the end of the parameter list or otherwise ensure it can only be provided by keyword without changing existing positional ordering.
def clone(
self,
to_linode=None,
region=None,
instance_type=None,
configs=[],
disks=[],
label=None,
group=None,
with_backups=None,
alerts: Optional[
Union[Dict[str, Any], InstanceACLPAlertsOptions]
] = None,
placement_group: Union[
InstancePlacementGroupAssignment,
"PlacementGroup",
Dict[str, Any],
int,
] = None,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Allow specify ACLP alerts with linode in create, get, list, update and clone.
✔️ How to Test
Unit test: